import {da} from "element-plus/es/locale/index.mjs"
import {useDollarGet, useDollarPost, useDollarPut, useDollarDelete} from "~/composables/useDollarFetchRequest"
import {objectToQueryString} from "~/utils/func"

// 登录或注册接口
export const loginOrRegisterAPI = async (data) => useDollarPost('/api/app/auth/loginOrRegister', data)
// 发送短信验证码接口
export const sendSmsCodeAPI = async (phonenumber) => useDollarGet('/api/resource/sms/code?' + objectToQueryString({phonenumber}))
// 企业入驻申请
export const addShopInfo = async (data) => useDollarPost('/api/company/company/apply', data)
// 退出登录接口
export const logoutAPI = async () => useDollarPost('/api/app/auth/logout')

// 找回密码
export const resetPwd = async (data) => useDollarPost('/api/app/auth/resetPwdBySms', data)
// 个人信息
export const userProfile = async (data) => useDollarGet('/api/system/user/profile?' + objectToQueryString(data))
// 获取用户信息
export const getUserInfo = async () => useDollarGet('/api/app/auth/getUserInfo')
// 卖家信息
export const getSalesBaseInfo = async (data) => useDollarPost('/api/skill/sales/app/getSalesBaseInfo')
// 我的关注列表
export const buyerConcernPage = async (data) => useDollarPost('/api/msb/concernRecord/buyerConcernPage', data)
// 新的关注列表接口
export const getFollowList = async (data) => useDollarGet('/api/shop/follow/list?' + objectToQueryString(data))
// 关注店铺
export const followShop = async (data) => useDollarGet('/api/shop/follow/follow?' + objectToQueryString(data))
// 取消关注店铺
export const cancelFollowShop = async (data) => useDollarGet('/api/shop/follow/cancel?' + objectToQueryString(data))
// 关注卖家
export const addBuyerConcern = async (data) => useDollarPost('/api/msb/concernRecord/buyerConcern', data)

// 分页查询我的订单-new
export const buyerOrderPage = async (data) => useDollarGet('/api/skill/buyerOrder/list?' + objectToQueryString(data))

// 买家创造企业
export const buyerCreateCompany = async (data) => useDollarPost('/api/company/company/apply', data)
// 买家查询企业
export const getCompanyInfo = async (data) => useDollarGet('/api/skill/company/my')
// 通过ID查询企业详情
export const getCompanyById = async (id) => useDollarGet(`/api/company/company/${id}`)
// 买家修改企业信息
export const updateCompany = async (data) => useDollarPut('/api/company/company', data)
// 分页查询企业员工
export const companyMemberPage = async (data) => useDollarGet('/api/skill/company/companyMemberPage?' + objectToQueryString(data))
// 增加企业成员（新接口）
export const addCompanyMember = async (data) => useDollarPost('/api/company/companyMember', data)
// 删除成员（新接口，路径参数ids）
export const deleteMember = async (ids) => useDollarDelete(`/api/company/companyMember/${ids}`)
// 转让管理员
export const changeAdmin = async (data) => useDollarPost('/api/system/member/changeAdmin', data)
// 买家获得的评论-分页
export const buyerCommentPage = async (data) => useDollarGet('/api/comment/comment/buyerGoodsDetailComment?' + objectToQueryString(data))
// 获取卖家评论分页
export const sellerCommentPage = async (data) => useDollarPost('/api/system/salesComment/salesCommentPage', data)
// 修改用户个人信息
export const putProfile = async (data) => useDollarPut('/api/system/user/profile', data)
// 更新用户完整信息（包括技能和教育背景）
export const updateInfo = async (data) => useDollarPost('/api/skill/sales/app/updateSalesBaseInfo', data)
// 注册用户信息-获取验证码
export const getRegisterCode = async (data) => useDollarPost('/api/system/sms/getSmsCode', data)
// 验证短信验证码
export const verifySmsCode = async (data) => useDollarPost('/api/app/auth/verifySmsCode', data)
// 我的账单-分页
export const orderBillPage = async (data) => useDollarPost('/api/system/orderBill/getOrderBillPage', data)
// 删除账单
export const deleteBill = async (data) => useDollarDelete('/api/system/orderBill/deleteBill', data)
// 开具发票 - 旧接口（保留兼容性）
export const issueInvoice = async (data) => useDollarPost('/api/system/orderBill/Invoicing', data)
// 发票申请 - 新接口
export const applyInvoice = async (data) => useDollarPost('/api/skill/invoice/apply', data)
// 删除订单发票
export const deleteInvoice = async (ids) => useDollarDelete(`/api/skill/invoice/${ids}`)
// 开票列表
export const buyerInvoiceList = async (data) => useDollarGet('/api/skill/invoice/buyerInvoiceList?' + objectToQueryString(data))
// 新增修改发票抬头
export const updateBillInfo = async (data) => useDollarPost('/api/system/bill/updateBillInfo', data)
// 新增发票抬头 - 新接口
export const companyBillInfo = async (data) => useDollarPost('/api/skill/companyBillInfo', data)
// 修改发票抬头 - PUT方式
export const updateCompanyBillInfo = async (data) => useDollarPut('/api/skill/companyBillInfo', data)
// 公司发票抬头-分页
export const companyBillPage = async (data) => useDollarPost('/api/system/bill/companyBillPage', data)
// 获取发票抬头列表
export const getCompanyBillInfoList = async () => useDollarGet('/api/skill/invoice/billInfo/list')
// 商业文案-分页
export const copywritingPage = async (data) => useDollarGet('/api/skill/index/public/copywritingPage?' + objectToQueryString(data))
// 买家推荐-分页
export const recommendPage = async (data) => useDollarGet('/api/skill/index/public/recommendPage?' + objectToQueryString(data))
// 买家得到卖家信息(聊天)
export const getSellerInfo = async (data) => useDollarPost('/api/system/buyerInfo/getBuyerChatInfo', data)
// 下载app
export const downloadApp = async (data) => useDollarGet('/api/skill/index/public/getPlatformQrCode')
// 获取协议等
export const getAgreement = async (data) => useDollarGet('/api/skill/index/public/getAgreementList')
// 获取协议规则详情
export const getAgreementDetails = async (data) => useDollarGet('/api/skill/index/public/getAgreementById?' + objectToQueryString(data))
// 绑定微信消息通知
export const bindingNotification = async (data) => useDollarPost('/api/wechat/bind/getWxBindResult', data)
// 卖家推荐Banner
export const sellerRecommendBanner = async (data) => useDollarPost('/api/skill/index/public/getSallerBanner', data)
// 查询搜索关键词记录
export const searchRecord = async (data) => useDollarGet('/api/skill/index/public/getAllType?' + objectToQueryString(data))
// 公司行业列表
// 通用获取字典数据
export const getDict = async (dictType) => useDollarGet('/api/system/dict/data/type/' + dictType)
// 注销用户（旧接口，保留兼容性）
export const deleteAccount = async (data) => useDollarDelete('/api/system/user/deleteAccount', data)
// 注销账号（新接口）
export const cancelAccount = async () => useDollarPost('/api/app/auth/cancelAccount')
// 修改手机号
export const changeAccount = async (data) => useDollarPost('/api/app/auth/updateMobile', data)
// 查询客服二维码
export const getCustomerService = async (data) => useDollarPost('/api/msb//public/getCustomerService', data)
// 企业理论（分页如果只取1条设定pageSize:1)
export const companyTheoryPage = async (data) => useDollarGet('/api/skill/index/public/philosophyPage?' + objectToQueryString(data))
// 关注账号列表(抖音知乎）
export const getConcernAccountList = async (data) => useDollarGet('/api/skill/index/public/getPlatformLink')

// 获取二维码URL
export const getQRCodeUrl = async (data) => useDollarPost('/api/userAuth/getAuthUrl', data)
// 检查二维码状态
export const checkQRCodeStatus = async (data) => useDollarPost('/api/userAuth/getAuthResult', data)

// 买家主页信息接口
export const buyerIndex = async () => useDollarGet('/api/buyer/user/buyerIndex')
// 买家主页评论列表接口
export const buyerIndexComment = async (data) => useDollarGet('/api/comment/comment/buyerIndexComment?' + objectToQueryString(data))

// 获取用户信息（开店页面初始化）
export const getShopUserInfo = async () => useDollarGet('/api/skill/shop/apply/getUserInfo')

// 提交开店申请
export const submitShopApply = async (data) => useDollarPost('/api/skill/shop/apply', data)

// 获取我的店铺信息
export const getMyShopInfo = async () => useDollarGet('/api/skill/shop/my')

// 店铺主页评论列表接口
export const shopIndexComment = async (data) => useDollarGet('/api/comment/comment/shopIndexComment?' + objectToQueryString(data))

// 店铺主页信息查询接口
export const getShopIndexInfo = async (data) => useDollarGet('/api/shop/shopInfo/getShopIndexInfo?' + objectToQueryString(data))







